<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>百度贴吧管理系统----帖子列表</title>
<link rel="stylesheet" href="../css/styling.css" type="text/css"
	media="screen" />
<link href="../img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<script type="text/javascript" src="../js/post/posts.js"></script>
</head>
<body>

	<!-- BEGIN global wrapper -->
	<!-- BEGIN header -->
	<div id="monster">

		<div id="tagline">
			<a href="../jsp/index.jsp"><img style="margin-left: -30px;"
				src="../img/logo.gif" width="150" height="48" /></a>
		</div>
		<!-- END tagline -->

		<!-- BEGIN tabs -->
		<div id="navcontainer">
			<ul id="navlist">
				<li><a id="taba" href="../jsp/index.jsp">首页</a></li>
				<li><a id="tabb" href="../user/listUserAction">用户列表</a></li>
				<li><a id="tabc" href="../tieba/listTiebaAction">贴吧列表</a></li>
				<li><a id="tabd" class="active" onclick="location.reload(true)">帖子列表</a></li>
			</ul>
		</div>
		<!-- END navcontainer -->

		<div id="tabbar"></div>
		<!-- END header -->

		<!-- BEGIN search -->
		<div id="search"></div>
		<!-- END search -->

		<!-- BEGIN container -->
		<div id="container">
			<!-- BEGIN left column -->
			<div id="left">
				<div id="lc">
					<div class="sidemenu">
						<ul>
                            <li><a href="../jsp/index.jsp">首&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;页</a></li>
                            <li><a href="../user/listUserAction">用户列表</a>
                            <li><a href="../tieba/listTiebaAction">贴吧列表</a></li>
                            <li><a href="../post/listPostAction">帖子列表</a></li>
                            <li>&nbsp;</li>
                            <li>&nbsp;</li>
                            <li>&nbsp;</li>
                            <li>&nbsp;</li>
                            <li>&nbsp;</li>
                            <li><a onclick="location.reload(true)">刷新页面</a></li>                            
                            <li><a onclick="javascript:history.back(-1);">返回上一页</a></li>
                        </ul>
					</div>
					<br class="clear" />
				</div>
				<!-- END lc -->
			</div>
			<!-- END left -->

			<!-- BEGIN center column -->
			<div id="center">
				<div id="cc">
					<p style="text-align: center;font-weight: bold;font-size: 18px;">帖子列表</p>
					<p style="text-align: center;">（点击查看帖子内容）<input type="button" value="添加新帖子"
							onclick="addPost()" /></p>
					<s:iterator id="postList" value="postList">
						<form method="post" action="showPostsContentAction"
							style="float: left;width:366px;">
							<span style="float:left;"><span style="font-weight: bold;">标题 :</span>
							<s:property value='#postList.getPostTitle()' />
							<span style="font-weight: bold;">作者 :</span>
							<s:property value='#postList.getPostUser().getUserName()' />
							<span style="font-weight: bold;">所在贴吧 :</span>
							<s:property value='#postList.getPostTieba().getTiebaName()' /></span>
							<input name="postContent"
								style="visibility: hidden;width: 0px;height: 0px;" type="text"
								value="<s:property value='#postList.getPostContent()' />" /> <input
								name="postTitle"
								style="visibility: hidden;width: 0px;height: 0px;" type="text"
								value="<s:property value='#postList.getPostTitle()' />" /> <input style="float: right;"
								value="查看" type="submit" /><input name="postAuthor"
								style="visibility: hidden;width: 0px;height: 0px;" type="text"
								value="<s:property value='#postList.getPostUser().getUserName()' />" />
							<input name="postTieba"
								style="visibility: hidden;width: 0px;height: 0px;" type="text"
								value="<s:property value='#postList.getPostTieba().getTiebaName()' />" />

						</form>
						<form method="post" action="deletePostAction" style="float: right;">
							<input value="删除" type="submit" /> <input name="postNo"
								style="visibility: hidden;width: 0px;height: 0px;" type="text"
								value="<s:property value='#postList.getPostNo()' />" /> <br />
						</form>
						<br />
						<br />
						<br />
					</s:iterator>
					<br/>
					<p style="text-align: center;font-size: 15px;">
						<%
							int pageCount = Integer.parseInt(request.getAttribute("pageCount")
									.toString());
							int pageNow = Integer.parseInt(request.getAttribute("pageNow")
									.toString());
						%>
						<a href="../post/listPostAction?pageNow=1">首页</a>&nbsp;&nbsp;&nbsp;
						<a
							href="../post/listPostAction?pageNow=
					<%if (pageNow <= 1) {
				out.print(1);
			} else
				out.print(pageNow - 1);%>">上一页</a>&nbsp;&nbsp;&nbsp;
						<%
							out.print("第 ");
						%>
						<%
							out.print(pageNow);
						%>
						<%
							out.print(" 页 共 ");
						%>
						<%
							out.print(pageCount);
						%>
						<%
							out.print(" 页");
						%>
						&nbsp;&nbsp;&nbsp;<a
							href="../post/listPostAction?pageNow=
					<%if (pageNow >= pageCount) {
				out.print(pageCount);
			} else
				out.print(pageNow + 1);%>
					">下一页</a>
						&nbsp;&nbsp;&nbsp;<a
							href="../post/listPostAction?pageNow=${pageCount}">尾页</a>
					</p>
				</div>
				<!-- END cc -->
			</div>
			<!-- END center -->

			<!-- BEGIN right column -->
			<div id="right">
				<div id="rc"></div>
				<!-- END rc -->
			</div>
			<!-- END right -->

			<br class="clear" />
			<!-- clear any float commands left -->
			<div class="clear">&nbsp;</div>

		</div>
		<!-- END container -->

		<!-- BEGIN footer -->
		<div id="footer">

			<!-- BEGIN bottomline links -->
			<div id="footmenu"></div>
			<!-- END footmenu -->

			<div class="author">Copyright &copy;2014 长沙理工大学 计算机与通信工程学院
				计算机科学与技术1204班 201250080419刘星鹭</div>

		</div>
		<!-- END footer -->

		<div class="clear">&nbsp;</div>

	</div>
	<!-- END monster -->

</body>

</html>

